package com.bjtech.web.util;

import java.io.Serializable;
import java.util.List;

import com.bjtech.dao.BaseBuildingInfoDao;
import com.bjtech.dao.BaseCityInfoDao;
import com.bjtech.dao.BaseProjectInfoDao;
import com.bjtech.dao.BaseRoomInfoDao;
import com.bjtech.dao.BaseShareAreaInfoDao;
import com.bjtech.dao.BaseUnitInfoDao;
import com.bjtech.dao.StandardSinkParamDao;
import com.bjtech.domain.BaseBuildingInfo;
import com.bjtech.domain.BaseProjectInfo;
import com.bjtech.domain.StandardSinkParam;
import com.bjtech.domain.query.BaseBuildingInfoQuerySpec;

public class Options implements Serializable {
	private static final long serialVersionUID = -1L;

	public List getProvinceList(Long parIndex) {
		BaseCityInfoDao dao = (BaseCityInfoDao) InitServletContextListener.getBean("baseCityInfoDao");
		return  dao.selectProvinceListByParIndex(parIndex);
	}
	
	public List getBuildingList(){
		BaseBuildingInfoDao dao = (BaseBuildingInfoDao) InitServletContextListener.getBean("baseBuildingInfoDao");
		return dao.selectEntityList(new BaseBuildingInfo(), new BaseBuildingInfoQuerySpec());
	}
	
	public List getUnitList(Long build_id){
		BaseUnitInfoDao dao = (BaseUnitInfoDao) InitServletContextListener.getBean("baseUnitInfoDao");
		return dao.selectUnitListByBuildId(build_id);
	}
	
	public List getRoomList(Long unit_id){
		BaseRoomInfoDao dao = (BaseRoomInfoDao) InitServletContextListener.getBean("baseRoomInfoDao");
		return dao.selectRoomListByUnitId(unit_id);
	}
	
	public List getAllProjList(){
		BaseProjectInfoDao dao  = (BaseProjectInfoDao) InitServletContextListener.getBean("baseProjectInfoDao");
		return dao.selectEntityList(new BaseProjectInfo(), new BaseBuildingInfoQuerySpec());
	}
	
	public List selectShareAreaList(Long proj_id){
		BaseShareAreaInfoDao dao  = (BaseShareAreaInfoDao) InitServletContextListener.getBean("baseShareAreaInfoDao");
		return dao.selectShareAreaListByProjId(proj_id);
	}
	
	public List selectBuidlingListByAreaId(Long area_id){
		BaseBuildingInfoDao dao = (BaseBuildingInfoDao)InitServletContextListener.getBean("baseBuildingInfoDao");
		return dao.selectBudilingListByAreaId(area_id);
	}
	
	public List selectRoomListByBuildId(Long buidlId){
		BaseRoomInfoDao dao = (BaseRoomInfoDao) InitServletContextListener.getBean("baseRoomInfoDao");
		return dao.selectRoomListByBuildId(buidlId);
	}
	
	public StandardSinkParam selectStandardValue(Long sinkId){
		StandardSinkParamDao dao = (StandardSinkParamDao) InitServletContextListener.getBean("standardSinkParamDao");
		return dao.selectEntity(new StandardSinkParam(), sinkId);
	}
	
	public List selectProjListByPIndex(Long p_index){
		BaseProjectInfoDao dao  = (BaseProjectInfoDao) InitServletContextListener.getBean("baseProjectInfoDao");
		return dao.selectProjListByPIndex(p_index);
	}
	
	public List selectBulidingListByPIndexForReport(Long proj_id){
		BaseBuildingInfoDao dao = (BaseBuildingInfoDao)InitServletContextListener.getBean("baseBuildingInfoDao");
		return dao.selectBulidingListByPIndexForReport(proj_id);
	}
}
